1. Technical Field
The invention relates to adjusting contrast in television pictures and other natural picture sequences, and more accurately to improving a single picture by modifying the histogram in a given fashion and to improving the picture sequence contrast by adjusting the method of modifying the histograms of successive pictures.
2. Discussion of Related Art
Histogram equalization is a known method for maximizing picture contrast. A histogram is the distribution of the brightness values of a picture, i.e. in order to create a histogram, the brightness values of a picture are grouped into classes, and the number of brightness values belonging to each class is calculated. The width of a class can vary according to the purpose of use of the histogram. When narrowest, the interval of the extreme values of a class can be one quantizing interval of a pixel value, in which case the histogram is essentially the same as the pixel value distribution. An example of a histogram is illustrated in FIG. 1, where the brightness values of an exemplary picture are divided into 256 classes.
In histogram equalization, the histogram is turned into a so-called mapping function whereby the brightness values of the source picture are converted into brightness values of the target picture, so that the histogram measured of the brightness values of the target picture is equalized. Converting with the mapping function corresponds to a non-linear amplification of an input signal, i.e. to expanding of certain intervals of the brightness distribution and reducing other intervals. In order to equalize a histogram, those areas in the pixel value distribution are expanded which in the original picture contain a lot of values, i.e. at these spots the mapping function must be sharp. A mapping function formed of the histogram of FIG. 1 and producing histogram equalization is illustrated in FIG. 2 (curve 1).
The wide, equally bright areas of the picture are seen as high and narrow peaks in the original histogram. The higher the peak of an original histogram, the wider in the target picture pixel value range are the original values contained in the peak expanded, wherefore the tone differences contained in such a picture area are disproportionately amplified. Such a spot is seen in the mapping function 1 of FIG. 2 as a steeply rising part. Thus the height of the histogram peak can be directly compared with the amplification of the pixel values in said area. Histogram equalization is not as such directly suited to natural pictures so well as for instance to improving contrast in medical pictures, because histogram equalization makes pictures look unnatural. Thus the unfavorable effects of histogram equalization on natural pictures are particularly due to too intensive amplification at some spot of the pixel value distribution.
The disadvantages of histogram equalization can be reduced by reducing the strength of the equalization. In that case the mapping function is evenly converted from a mapping function 1 producing a complete histogram equalization towards a mapping function 3 (i.e. diameter of the diagram) corresponding to zero strength. In the example of FIG. 2, the attenuated mapping function 2 is located in between these two. However, a general reduction in the equalization strength deteriorates the obtained result as for other picture areas apart from those corresponding to the histogram peak.
For the picture there can be defined a maximum amplification limit that must not be surpassed by the histogram peaks. Possible peak values surpassing this limit can be cut out of the histogram already prior to forming the mapping function. The cut-out values must be distributed back to the histogram in order to form the mapping function correctly.
The redistribution of the values cut out of the histogram can be carried out either in consideration to the cutting limit so that it is not surpassed anew, or by allowing it to be surpassed as a consequence of the division. The former case requires more iteration layers, i.e. a lot of calculation power, wherefore it is poorly suited to real-time video signal processing. As for the latter case, it does not offer proper maximum amplification control with the low values of the maximum amplification limit.
The processing of picture sequences sets additional requirements to histogram equalization. If the histogram equalization is performed for each picture separately, even the fairly slight differences contained in the pictures alter the mapping function to such extent that it results in disturbing flickering. Flickering can be eliminated by filtering the histograms temporally, for instance by averaging histograms measured of successive pictures, and by forming the mapping function on the basis of the filtered histogram. A simple average does not, however, eliminate flickering effectively enough. The flickering can be eliminated with sufficiently strong averaging of successive histograms, but then the contrast is distorted at the intersection of the picture sequences, where the picture content changes remarkably, because the pixel value distribution of the pictures preceding the intersection affects the processing of the pictures succeeding the intersection.
The selection of available filters is restricted by the delay caused by them. When the histograms are measured picture by picture, each delay of the filter requires a picture memory, whereby the picture signal is respectively delayed.